<?php
	$data             = array();
	$db               =  new model_provider;
	$data['title']    = "Nhóm sản phẩm";
	$data['template'] = "provider/add_provider";
	$data['act']      = 0;
	$data['group']    = $db->list_group();
	if(isset($_POST['ok'])){
		$data = array(
			"tennhacungcap" => $_POST['providername'],
			"diachi"        => $_POST['address'],
			"dienthoai"     => $_POST['phone'],
		);
		$db->add_provider($data);
		header('location:index.php?mod=provider&act=list');
	}else{
		loadview("layout",$data);
	}